<!DOCTYPE HTML>
<html>
    <head>
        <!--<meta charset="utf-8">-->
        <meta name="viewport" content="width=device-width,initial-scale=1.0">
        <title>maintest3</title>
        <!--[if IE]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <link href="<?php echo Yii::app()->baseUrl; ?>/css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <style>
            .bor{border: 1px red solid}
        </style>

    </head>
    <body><div class="container">
            <input type="text" placeholder="被减数/被除数" id="num1"><br><br>
            <input type="text" placeholder="减数/除数" id="num2"><br><br>
            <input type="text" readonly="value"  id="show" placeholder="Result  readonly"><br>
        </div>
        <br/>
        <button onclick="add()">add</button>
        <button onclick="subtract()">subtract</button>
        <button onclick="multiply()">multiply</button>
        <button onclick="divide()">divide</button>
        <script>
            var num1, num2, sum;
            function add()
            {
                num1 = document.getElementById("num1").value;
                num2 = document.getElementById("num2").value;
                sum = parseFloat(num1) + parseFloat(num2);
                document.getElementById("show").value = sum;
            }
            function subtract()
            {
                num1 = document.getElementById("num1").value;
                num2 = document.getElementById("num2").value;
                sum = parseFloat(num1)-parseFloat(num2);
                document.getElementById("show").value = sum;
            }
            function multiply()
            {
                num1 = document.getElementById("num1").value;
                num2 = document.getElementById("num2").value;
                sum = parseFloat(num1)*parseFloat(num2);
                document.getElementById("show").value = sum;
            }
            function divide()
            {
                num1 = document.getElementById("num1").value;
                num2 = document.getElementById("num2").value;
                sum = parseFloat(num1)/parseFloat(num2);
                document.getElementById("show").value = sum;
            }
        </script>

        <script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/jquery-1.9.1.js"></script>
        <script src="<?php echo Yii::app()->baseUrl; ?>/assets/js/bootstrap.min.js"></script>
    </body>
</html>